<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>01父子组件传递数据</title>
</head>

<body>

  <div id="app">
    <cpn :cmessage="message" :cmovies="movies"></cpn>
  </div>

  <template id='cpn'>
    <div>
      <ul>
        <li v-for="item in cmovies">{{item}}</li>
      </ul>
      <h2>{{cmessage}}</h2>
    </div>
  </template>

  <script src="../vue/vue.js"></script>
  <!-- <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.13/vue.common.dev.js"></script> -->
  <!-- <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.0-beta.7/vue.cjs.js"></script> -->
  <script>

    const cpn = {
      template: '#cpn',

      props: {
        cmessage: {
          type: String,
          defaule: 'defaule message'
        },
        cmovies:{
          type:Array
        }
      },

      data() {
        return {}
      }

    }

    const app = new Vue({
      el: '#app',
      data: {
        message: 'hello',
        movies: ['xxx1', 'xxx2', 'xxx3']
      },
      //局部注册
      components: {
        cpn
      }
    })

  </script>
</body>

</html>